<?php
/**
 * User: shutao
 * @var View $this
 */

use yii\web\View;

$this->title = '关键词列表';
?>
<div ng-controller="keywordIndexCtrl">
    <div class="xblock">
        <button class="layui-btn layui-btn-xs" ng-click="toEdit(0)">
            <i class="icon iconfont layui-extend-add"></i> 添加关键词
        </button>
        <span class="x-right">共有数据：<span><span ng-bind="pagination.itemsCount">0</span> 条</span></span>
    </div>

    <table class="layui-table">
        <tr>
            <th>#</th>
            <th style="width: 100px;">所属公众号</th>
            <th style="width: 100px;">关键词</th>
            <th style="width: 100px;">时间</th>
            <th style="width: 50px;">状态</th>
            <th>关联回复(点击预览)</th>
            <th style="width: 130px;">操作</th>
            <th></th>
        </tr>

        <tr ng-repeat="x in datas">
            <td><span ng-bind="x.id"></span></td>
            <td><span ng-bind="x.wc_title"></span></td>
            <td><span ng-bind="x.keyword"></span></td>
            <td>
                <div ng-show="x.start > 0">生效: <span ng-bind="x.start *1000 | date:'yyyy-MM-dd HH:mm:ss'"></span></div>
                <div ng-show="x.close > 0">失效: <span ng-bind="x.end *1000 | date:'yyyy-MM-dd HH:mm:ss'"></span></div>
            </td>
            <td><span ng-bind="x.status_text"></span></td>
            <td>
                <div ng-show="x.wc_id > 0" ng-click="preview(x)">
                    [<span ng-bind="x.c_type_text"></span>]<span class="pointer"
                                                                 ng-bind="x.c_title"></span>
                </div>
            </td>
            <td>
                <button ng-click="toEdit(x,$index)" title="编辑"
                        class="layui-btn layui-btn-xs layui-btn-warm"><i class="layui-icon">&#xe642;</i>
                </button>
                <button ng-click="toDelete(x,$index)" title="删除"
                        class="layui-btn layui-btn-xs layui-btn-danger"><i class="layui-icon">&#xe640;</i>
                </button>
            </td>
            <td></td>
        </tr>
    </table>
    <div pagination="pagination" class="pagination"></div>
</div>
<input name="_csrf" type="hidden" id="_csrf" value="<?= \Yii::$app->request->csrfToken ?>">